package com.lq.ecoldchain.util

import android.content.Context
import java.io.BufferedReader
import java.io.IOException
import java.io.InputStreamReader


/*
*2019/1/2 0002  18:07
*function by lq
*/
object GsonUtils {
    fun getJson(context: Context, fileName: String): String {
        val stringBuilder = StringBuilder()
        try {
            val assetManager = context.assets
            val bf = BufferedReader(InputStreamReader(
                    assetManager.open(fileName)))
            while ((bf.readLine()) != null) {
                stringBuilder.append(bf.readLine())
            }
        } catch (e: IOException) {
            e.printStackTrace()
        }
        return stringBuilder.toString()
    }
}